<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title></title>
		<script>
			function test(){
				alert("你已经成功调用了test函数");
			}
		</script>
	</head>
	<body>
		<script>
			test();
		</script>
		<button onclick="test()">按钮</button>
		
		<div onclick="test()">点击链接调用函数</div>
		<a href="#" onclick="test()">点击链接调用函数</a>
		
		<a href="javascript:test()">点击链接调用函数</a>
		
	</body>
</html>
